import Papa from 'papaparse'
export function paPaParseCSV(file, callback) { 
    let i=0;
    let csvPreview = [];
    Papa.parse(file, {
        header: true,
        skipEmptyLines: true,
        step: function(results, parser) {
            i++;
            csvPreview.push(results.data);
            if(i > 49){
                parser.abort();
            }
        },
        complete: function (results, file) {
            console.log("All files done!");
            callback(csvPreview);
       }
    });
}

